package org.nekperu15739.aboutme.business.service;



import java.util.ArrayList;
import java.util.List;

import nekperu15739.me.persistencejpa.dto.LanguageJpaDto;

import org.nekperu15739.aboutme.persistencejpa.entities.implementation.i18n.LanguageEntityJpa;
import org.nekperu15739.me.persistencejpa.dao.interfaces.i18n.LanguageDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LanguageBusinessService {

    private LanguageDao languageDao;

    public List<LanguageJpaDto> selectList() {
        List<LanguageEntityJpa> languageEntityJpaList = getLanguageDao().selectList();
        List<LanguageJpaDto> languageJpaDtoList = new ArrayList<LanguageJpaDto>();
        
        for(LanguageEntityJpa languageEntityJpa: languageEntityJpaList) {
            languageJpaDtoList.add(new LanguageJpaDto(languageEntityJpa));
        }
        
        return languageJpaDtoList;
    }

    private LanguageDao getLanguageDao() {
        return languageDao;
    }

    @Autowired
    private void setLanguageDao(LanguageDao languageDao) {
        this.languageDao = languageDao;
    }
}
